//
// Created by xili on 2024/8/2 21:55.
// Go big or go home.
//
#include <iostream>
#include <vector>
#include <unordered_set>

using namespace std;

class Solution {
public:
    int countConsistentStrings(string allowed, vector<string> &words) {
        unordered_set<char> s;
        int ans = words.size();
        for (auto &item: allowed) {
            s.emplace(item);
        }
        for (auto &item: words) {
            bool flag = true;
            for (auto item1: item) {
                if (!s.count(item1)) {
                    ans--;
                    break;
                }
            }
        }
        return ans;
    }
};